<template>
  <div id="app">
    <site-header ></site-header>
    <div class="main">
      <router-view :rootPath="rootPath"></router-view>
    </div>
    <side-footer></side-footer>
  </div>
</template>

<style>
  /*重置样式*/
  body,button,dd,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,hr,input,legend,li,ol,p,pre,td,textarea,th,ul{
    margin: 0;
    padding: 0;
  }

  html {
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%
  }

  html body,body button,body input,body select,body textarea{
    font:14px "Microsoft YaHei",tahoma,arial,'Hiragino Sans GB',\5b8b\4f53,sans-serif;
  }
  html body{
    background: #fafafa;
  }
  .main a{
    color: #666;
    text-decoration: none;
  }
  .main a:hover{
    text-decoration: none;
    color: #e03c02;
  }
  ul,li{
    list-style: none;
  }
  /*全局样式*/
  .main {
    width: 960px;
    min-height: 480px;
    overflow: hidden;
    background: #fff;
    margin: 0 auto;
    padding: 10px;
    margin-top: 20px;
  }
  .main h5 {
    padding: 10px 0;
  }
  .main h4{
    font-size: 16px;
    margin: 0;
  }

  .main h4 a{
    color: #333;
  }
  .main h4 a:hover {
    color: #f40;
  }
  .return{
    margin-bottom: 15px;
  }
  .label-control {
    display: inline-block;
    height: 34px;
    line-height: 34px;
  }

  .errorTest {
    padding: 10px 0;
    color: #f40;
  }

  #easyEdit {
    min-height: 480px;
    padding: 10px;
  }
  .careBtn {
    background: #fff;
    border: 1px solid #eee;
    padding: 2px 7px;
    margin-top: 6px;
    font-size: 14px;
  }
  
</style>

<script>
  import SiteHeader from './components/common/siteHeader'
  import SideFooter from './components/common/sideFooter'
  import Storage from './servers/Storage'
  export default {
    data () {
      return {
      }
    },
    components: {
      SiteHeader, SideFooter
    },
    computed: {
      rootPath () {
        return this.$store.state.rootPath
      }
    },
    mounted () {
      /*session*/
      var userInfo = Storage.get(Storage.key);
      if (userInfo) {
        this.$store.commit('logined', userInfo)
      }

      /*加载js*/
      var jquery = document.createElement('script')
      jquery.src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"
      jquery.onload = function () {
        var wang = document.createElement('script')
        wang.src = 'http://cdn.bootcss.com/wangeditor/2.1.20/js/wangEditor.min.js'
        document.body.appendChild(wang)
      }
      document.body.appendChild(jquery)
    }
  }

</script>